import { md5 } from "./md5";

export function objSort(obj: any) {
    if(typeof obj === 'object'){
        const res = {};
        Object.keys(obj).sort().map(it => {
            const val = obj[it]
            Reflect.set(res, it, objSort(val))
        })
        return res;
    }
    return obj;
}
export function objectHash(obj: any) {
    return md5(JSON.stringify(obj))
}